﻿@{
    var TID = ViewData["TID"] as int?;
}
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>@ViewData["Title"] - 移动审批</title>
    <link rel="stylesheet" href="//unpkg.com/layui@2.6.8/dist/css/layui.css" />
    <link rel="stylesheet" href="~/lib/bootstrap/dist/css/bootstrap.min.css" />
    <link rel="stylesheet" href="~/css/site.css" asp-append-version="true">
    <script src="//unpkg.com/layui@2.6.8/dist/layui.js"></script>
</head>
<body>
    
<script src="~/lib/jquery/dist/jquery.min.js"></script>
<script src="~/lib/bootstrap/dist/js/bootstrap.bundle.min.js"></script>
<script src="~/js/site.js" asp-append-version="true"></script>

<!-- 正文开始 -->
<div class="layui-fluid">
    <div class="layui-card">
        <div class="layui-card-body">
            <table class="layui-table" lay-even lay-skin="line" lay-size="lg" id="demo" lay-filter="tableAuth"></table>
        </div>
    </div>
</div>
<!-- js部分 -->
<script>
    layui.use(['table'], function () {
        var $ = layui.jquery;
        var table = layui.table;
        var i=0;
        // 渲染表格
        table.render({
        elem: '#demo'
        ,height: 400
        ,url: "/api/Approve/limit?taskId=@TID"
        ,title: '用户表'
        ,cols: [[ //表头
            {field: 'na', title: '限额名称', width:80, fixed: 'left'}
            ,{ field: 'ty', title: '限额类型', minWidth: 200 }
            ,{ field: 'bf', title: '交易前结果', minWidth: 200 }
            ,{ field: 'af', title: '交易后结果', minWidth: 200 }
            ,{ field: 'df', title: '差值', minWidth: 200 }
            ,{ field: 'ca', title: '风险情况', minWidth: 200 }
            ,{ field: 'le', title: '限额级别', minWidth: 200,templet: function (d) {
                switch(d.le){
                    case "0": return "<span style='color: green'>绿灯</span>";
                    case "1": return "<span style='color: yellow'>黄灯</span>";
                    case "2": return "<span style='color: orange'>橙灯</span>";
                    case "3": return "<span style='color: red'>红灯</span>";
                    default: return d.le;
                }
            } }      //   0 绿灯 1黄灯 2橙灯 3红灯
            ,{ field: 'sid', title: '交易编号', minWidth: 200 }
            ,{ field: 'me', title: '指标名称', minWidth: 200 }
        ]]
    });
});
</script>

</body>
</html>

